import { apiHttp } from '/@/utils/axios';
import type { commonResponse } from './common'


export interface companyBaseModel {
  corpId: string;
  corpCode: string;
  corpName: string;
  regType?: string;
  legalPerson?: string;
  corpOldName?: string;
  regionName?: string;
  compRegAddr?: string;
  enterCorp?: string;
  compRegDate?: number;
  lastUpdate?: number;
  creationTime?: number;
}

export interface articleModel {
  article_id?: string;
  article_summary?: string;
  article_title?: string;
  article_type?: string;
  cover_img_id?: string;
  file_id?: string;
  item_id?: string;
  item_name?: string;
  order_no?: number;
  publish_time?: number;
  publish_unit?: string;
  read_count?: number;
}

export enum cmsFirstEnum {
  cms_safe_cert = '安许证业务',
  cms_reg_cert = '执业资格注册业务' ,
  cms_ry_cert	 = '安全三类、特种作业人员业务',
  cms_apt_cert = '企业资质申报业务',
  cms_proj_mgr = '工程项目监管业务',
  cms_credit = '信用评价业务',
  cms_jinjiang = '区外进疆企业信息报送业务' ,
  cms_exam = '教育培训考试业务' ,
  cms_performance	= '历史业务补录业务',
  cms_dynamic_inspect = '企业资质动态核查'
}


export const getItemTreeApi = params => {
  return apiHttp.post<commonResponse>({ url: '/cms/item/itemTree', params }, { isTransformRequestResult: false });
}

export const getArticleListApi = params => {
  return apiHttp.post<commonResponse>({ url: '/cms/item/articleList', params }, { isTransformRequestResult: false });
}

export const getArticleDetailApi = id => {
  return apiHttp.get({ url: '/cms/article/detail/'+id });
}

export const getListFileItemsApi = params => {
  return apiHttp.post<commonResponse>({ url: '/file/listFileItems' , params }, { isTransformRequestResult: false });
}

export const getUrgentApi = () => {
  return apiHttp.get({url: "/cms/article/urgent"})
}
